/*
    页面名称：管理员 -添加员工
    作者: 苗怀雨
    时间:2017年12月31日
    最后编辑：2017年12月31日20:20:13
*/

$(document).ready(function() {
});

function bigImage(e) {
    var $modal = $("div.bigImage");
    var imageSrc = $(e).children("img").attr("src");

    $modal.find("img").attr("src",imageSrc);
}

/* 查看图书按钮*/
function bookInfo(bookId){
    var bookId = bookId;
    window.location.href = "bookInfoPage?bookId=" + bookId;
}

function searchBooks(e,author,publish,bookClass,type,bookName) {
    var $this = $(e);
    var pageNum = $this.text();
    var pageSize = 10;
    var $bookName = bookName;
    var $author = author;
    var $publish = publish;
    var $type = type;
    var $bookClass = bookClass;

    var $form = $("<div class='postForm'></div>");
    var $elem = $("<div class='postParam'></div>");

    $elem.attr("id","pageNum");
    $elem.text(pageNum);
    $form.append($elem.clone());

    $elem.attr("id","pageSize");
    $elem.text(pageSize);
    $form.append($elem.clone());

    $elem.attr("id","author");
    $elem.text($author);
    $form.append($elem.clone());

    $elem.attr("id","publish");
    $elem.text($publish);
    $form.append($elem.clone());

    $elem.attr("id","bookName");
    $elem.text($bookName);
    $form.append($elem.clone());

    $elem.attr("id","bookClass");
    $elem.text($bookClass);
    $form.append($elem.clone());

    $elem.attr("id","type");
    $elem.text($type);
    $form.append($elem.clone());

    postForm("bookSearch",$form);
}
